package com.hnkywl.sts.entity.htgl;

import com.hnkywl.sts.entity.BaseEntity;
import com.hnkywl.sts.entity.organ.Nbgs;
import org.hibernate.annotations.Where;

import javax.persistence.*;
import java.sql.Clob;
import java.util.List;

/**
 * 说明：合同定义
 * 包:        com.hnkywl.sts.entity.htgl
 * 类描述:    合同定义
 * 修改备注: [说明本次修改内容]
 * 版本:        [v1.0]
 */
@Entity
@Table(name = "T_BIZ_HTDY")
@Where(clause = "deleted!='1'")
public class Htdy extends BaseEntity {
    @Id
    @SequenceGenerator(name = "seqHtdy", allocationSize = 1, sequenceName = "SEQ_BIZ_HTDY")
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seqHtdy")
    private Long id;

    /**
     * 名称
     */
    private String mc;

    /**
     * 关联HTML
     */
    @Lob
    @Column(name = "html")
    private String html;

    /**
     * 合同类型，采购合同：cght，销售合同：xsht
     */
    private String htlx;

    /**
     * 合同元素
     */
    @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy = "htdy", targetEntity = Htys.class)
    private List<Htys> htysList;

    /**
     * 备注
     */
    private String bz;

    /**
     * 合同文本
     */
    @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy = "htdy", targetEntity = Htwb.class)
    private List<Htwb> htwbList;

    /**
     * 内部公司
     */
    @ManyToOne
    @JoinColumn(name="NBGS_ID")
    private Nbgs nbgs;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getMc() {
        return mc;
    }

    public void setMc(String mc) {
        this.mc = mc;
    }

    public String getHtml() {
        return html;
    }

    public void setHtml(String html) {
        this.html = html;
    }

    public List<Htys> getHtysList() {
        return htysList;
    }

    public void setHtysList(List<Htys> htysList) {
        this.htysList = htysList;
    }

    public String getBz() {
        return bz;
    }

    public void setBz(String bz) {
        this.bz = bz;
    }

    public List<Htwb> getHtwbList() {
        return htwbList;
    }

    public void setHtwbList(List<Htwb> htwbList) {
        this.htwbList = htwbList;
    }

    public String getHtlx() {
        return htlx;
    }

    public void setHtlx(String htlx) {
        this.htlx = htlx;
    }

    public Nbgs getNbgs() {
        return nbgs;
    }

    public void setNbgs(Nbgs nbgs) {
        this.nbgs = nbgs;
    }
}
